Name :Relative Displacement command

Symbol :MC_MoveRelative

Illustrate:

    It is used to realize the relative displacement function of the shaft, and the rising edge is effective.
    This command can only be invoked if the axis is enabled using the MC_Power command.
    On the rising edge of EXECUTE, the input DISTANCE, VEL, ACC, JERK values are locked, and the PLCOpen state machine of the axis switches to DiscreteMotion and starts the relative displacement movement.
    IF THE DISTANC IS GREATER THAN 0, THE AXIS WILL MOVE IN THE FORWARD DIRECTION, AND IF THE DISTANCE IS LESS THAN 0, THE AXIS WILL MOVE IN THE OPPOSITE DIRECTION, MOVING THE GIVEN DISTANCE.
    This command can be interrupted and terminated: Instructions that can keep the axis in the ContinuousMotion, DiscreteMotion, and Stopping states can interrupt this command (the PLCOpen state machine of the reference axis), and when interrupted, the CMDABORTED will be valid, and the remaining unfinished distance will be discarded.
    When the axis runs against the software limit, the command will be interrupted (CMDABORTED is valid), and the axis will stop moving but will not enter the Errorstop state, which can be modified to be far away from the target position of the software limit and re-triggered. 

Image:

Parameter:

The name of the parameter data type IN/OUT Parameter role Illustrate Default value
AXISNO UDINT IN Pulse shaft number 0-7
not
EXECUTE BOOL IN Function block triggering The rising edge triggers the execution of the order
FALSE
DISTANCE REAL IN Relative distance With the current position as a reference, the distance of the target moving (non-0, positive - positive direction; negative - opposite direction; absolute value is the distance traveled), in units: unit
not
VEL REAL IN Target speed Target speed(non-0 value, absolute value valid), ≤ maximum acceleration, unit: unit/s
not
ACC REAL IN acceleration acceleration(non-0 value, absolute value valid), ≤ maximum acceleration, unit:unit/s
not
JERK REAL IN J&A Acceleration (valid in absolute terms), ≤ acceleration (0-T type acceleration and deceleration, non-0-S type acceleration and deceleration), unit:unit/s^2
not
DIR USINT IN direction Rotational motion is reserved, linear motion is invalid
not
DONE BOOL OUT Completion flag TRUE:The execution is completed and the target location is reached
FALSE
BUSY BOOL OUT Busy sign TRUE:is in motion
FALSE
CMDABORTED BOOL OUT End execution flag TRUE:If it is interrupted by other instructions, the execution of this instruction will be terminated
FALSE
ERROR BOOL OUT Error flags TRUE:There was an error with the function block call
FALSE
ERRORID UINT OUT Error codes 0:Normal, Other: Error code value
0

Example:

LD:

ST:



Interpretation:

   AXISNO is 0, which means that the operating pulse axis is 0;
   EXECUTE is FALSE->TRUE, AND THE RISING EDGE TRIGGERS THE EXECUTION OF THE INSTRUCTION;
   DISTANCE is 125, which indicates the distance of 125 units in the forward direction with the current position as a reference.
   VEL is 20, which means that the target speed is 20unit/s;
   ACC is 100, which means acceleration and deceleration at 100 unit/s until the target speed of 20 unit/s is reached;
   If JERK is 0, it will perform T-shaped acceleration and deceleration motion, and if it is not 0, it will perform S-type acceleration and deceleration motion;
   DIR is 0, reserved for rotational motion, not valid for linear motion;
   If DoneOut is TRUE, the relative displacement is executed.
   If BusyOut is TRUE, the relative displacement is being performed, and the BusyOut is reset after completion.
   If CmdAbortOut is TRUE, the execution has been terminated due to interruption.
   If ErrorOut is TURE, it means that there is an error and the command cannot be executed.
   If ErrorIdOut is 0, the execution is normal, and if it is not 0, there is an error and cannot be executed.